<?php
/* -------------------------------------------------------------------------------------
* 	fork by itDOT Media - dirk mueller
* 	http://www.itdotmedia.de
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */
function get_shippingtime_rank($kind, $val) {
  global $db;
  if (strpos($kind, 'shipping_status') === false) $kind = 'shipping_status_'.$kind;

  $sql = "select * from ".TABLE_SHIPPING_STATUS; 
  $rec = $db->db_query($sql, false);
  while(!$rec->EOF) {
    if ($rec->fields[$kind] == $val && $rec->fields["language_id"] == $_SESSION['languages_id']) {
      return $rec->fields['shipping_status_ranking'];
    }
    $rec->moveNext();
  }
  return 0;
}

function get_shippingtime_name($kind, $val) {
  global $db;
  if (strpos($kind, 'shipping_status') === false) $kind = 'shipping_status_'.$kind;

  $sql = "select * from ".TABLE_SHIPPING_STATUS; 
  $rec = $db->db_query($sql, false);
  while(!$rec->EOF) {
    if ($rec->fields[$kind] == $val && $rec->fields["language_id"] == $_SESSION['languages_id']) {
      return $rec->fields['shipping_status_name'];
    }
    $rec->moveNext();
  }
  return 0;
}